package com.tcm.ucenter.domain.enums;

/**
 * @author 账户收支来源类型
 */
public enum AccountSourceEnum {

    /**
     * 购物币
     */
    COIN("5", "购物币"),
    /**
     * 积分
     */
    POINT("4", "积分"),

    /**
     * 充值
     */
    RECHARGE("3", "充值"),

    /**
     * 购药订单
     */
    BUY_ORDER("2", "购药订单"),

    /**
     * 问诊付费
     */
    CONSULTATION_PAID("1", "问诊付费"),
    ;

    /**
     * 类型
     */
    private final String value;
    /**
     * 描述
     */
    private final String description;

    AccountSourceEnum(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public String value() {
        return this.value;
    }

    public String description() {
        return this.description;
    }

    public static String getValue(String value) {
        AccountSourceEnum[] sexEnums = values();
        for (AccountSourceEnum sexEnum : sexEnums) {
            if (sexEnum.value().equals(value)) {
                return sexEnum.value();
            }
        }
        return null;
    }

    public static String getDesc(String value) {
        AccountSourceEnum[] sexEnums = values();
        for (AccountSourceEnum sexEnum : sexEnums) {
            if (sexEnum.value().equals(value)) {
                return sexEnum.description();
            }
        }
        return null;
    }

}
